﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>流程图DEMO</title>
    <!--[if lt IE 9]>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="codebase/GooFlow2.css"/>
    <link rel="stylesheet" href="/assets/libs/layui/css/layui.css"/>
    <!--<link rel="stylesheet" type="text/css" href="codebase/GooFlow.css"/>-->
    <style>
        .myForm {
            display: block;
            margin: 0px;
            padding: 0px;
            line-height: 1.5;
            border: #ccc 1px solid;
            font: 12px Arial, Helvetica, sans-serif;
            margin: 5px 5px 0px 0px;
            border-radius: 4px;
        }

        .myForm .form_title {
            background: #428bca;
            padding: 4px;
            color: #fff;
            border-radius: 3px 3px 0px 0px;
        }

        .myForm .form_content {
            padding: 4px;
            background: #fff;
        }

        .myForm .form_content table {
            border: 0px
        }

        .myForm .form_content table td {
            border: 0px
        }

        .myForm .form_content table .th {
            text-align: right;
            font-weight: bold
        }

        .myForm .form_btn_div {
            text-align: center;
            border-top: #ccc 1px solid;
            background: #f5f5f5;
            padding: 4px;
            border-radius: 0px 0px 3px 3px;
        }

        .ew-cascader-group {
            display: inline-block;
            width: 100%;
        }

        .layui-form-label {
            padding: 9px 0px;
            text-align: left;
        }

        .layui-form-radio {
            margin: 0px;
        }

        #propertyForm {
            float: right;
            width: 350px
        }
    </style>
</head>
<body style="background:#EEEEEE">

<div id="demo" style="margin:5px;float:left"></div>
<!--<form class="myForm" id="propertyForm">-->
<!--<div class="form_title">节点详情</div>-->
<!--<div class="form_content">-->
<!--<form class="layui-form">-->
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">Id:</label>-->
<!--<div class="layui-input-inline">-->
<!--<input type="text" class="layui-input" readonly id="id"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">节点类型:</label>-->
<!--<div class="layui-input-inline">-->
<!--<input type="text" class="layui-input" readonly id="type"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="layui-form-item">-->
<!--<label class="layui-form-label">主题类型：</label>-->
<!--<div class="layui-input-inline" style="width: 660px">-->
<!--<input type="radio" name="level" lay-filter="levelM" value="1" title="一级分类">-->
<!--<input type="radio" name="level" lay-filter="levelM" value="2" title="二级分类">-->
<!--<input type="radio" name="level" lay-filter="levelM" value="3" title="三级分类">-->
<!--</div>-->
<!--</div>-->

<!--<div>-->
<!--<label class="layui-form-label">审核人：</label>-->
<!--<div class="layui-input-inline">-->
<!--<input id="demoCascader9" placeholder="请选择" class="layui-hide"/>-->
<!--</div>-->
<!--</div>-->
<!--<div>-->
<!--<label class="layui-form-label">审核人：</label>-->
<!--<td>-->
<!--<select type="text" style="width:120px" id="name">-->
<!--<option></option>-->
<!--<option value="1">上级领导</option>-->
<!--<option value="2">用人部门</option>-->
<!--<option value="3">综合管理部</option>-->
<!--<option value="4">安全环保部</option>-->
<!--<option value="5">机械电气部</option>-->
<!--<option value="6">分管领导</option>-->
<!--<option value="7">总经理</option>-->
<!--</select>-->
<!--</td>-->
<!--</div>-->
<!--<tr>-->
<!--<td class="th">起始位置：</td>-->
<!--<td><input type="text" readonly style="width:120px" id="from"/></td>-->
<!--</tr>-->
<!--<tr>-->
<!--<td class="th">结束位置：</td>-->
<!--<td><input type="text" readonly style="width:120px" id="to"/></td>-->
<!--</tr>-->
<!--<tr><td class="th">Model：</td><td><input type="text" style="width:120px" id="model"/></td></tr>-->
<!--<tr><td class="th">Left-r：</td><td><input type="text" style="width:120px" id="left"/></td></tr>-->
<!--<tr><td class="th">Top-r：</td><td><input type="text" style="width:120px" id="top"/></td></tr>-->
<!--<tr><td class="th">Width：</td><td><input type="text" style="width:120px" id="width"/></td></tr>-->
<!--<tr><td class="th">Height：</td><td><input type="text" style="width:120px" id="height"/></td></tr>-->
<!--</form>-->

<!--</div>-->
<!--<div class="form_btn_div">-->
<!--<input type="button" value="确定" onclick="updateInfo(demo.$focus)"/>-->
<!--</div>-->
<!--</form>-->
<form class="layui-form myForm" id="propertyForm">
    <div class="form_title">节点详情</div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-required">ID:</label>
        <div class="layui-input-block">
            <input name="title" class="layui-input" id="id" readonly/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-required">节点类型:</label>
        <div class="layui-input-block">
            <input id="type" class="layui-input" readonly/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">审核类型:</label>
        <div class="layui-input-block">
            <input type="radio" name="approveRole" lay-filter="radio" value="1" title="审核人">
            <input type="radio" name="approveRole" lay-filter="radio" value="3" title="组织">
            <input type="radio" name="approveRole" lay-filter="radio" value="2" title="角色">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">审核人:</label>
        <div class="layui-input-block">
            <input id="demoCascader9" placeholder="请选择" class="layui-input"/>

        </div>
    </div>
    <div class="form_btn_div">
        <input type="button" value="确定" onclick="updateInfo(demo.$focus)"/>
    </div>
</form>


<div style="clear:both">
    <input id="submit" type="button" value='保存' onclick="Export()"/>
    <textarea id="result" row="6"></textarea>
</div>
</body>
<script type="text/javascript" src="child.js"></script>
<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../GooFunc.js"></script>
<link rel="stylesheet" type="text/css" href="../default.css"/>
<script type="text/javascript" src="codebase/GooFlow.js"></script>
<script type="text/javascript" src="codebase/GooFlow_color.js"></script>
<script type="text/javascript" src="index.js"></script>

<script type="text/javascript" src="/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/assets/js/common.js?v=317"></script>
<script type="text/javascript" src="/assets/js/js.cookie.min.js"></script>
<script type="text/javascript" src="/assets/js/sqjx.js"></script>
<script>
    var orgList, userList, roleList;
    var cascader,form
    layui.use(['layer', 'form', 'tableX', 'cascader'], function () {
        queryUserList();
        getMainOrgList();
        getRoleList();
        var $ = layui.jquery;
        cascader = layui.cascader;
        form = layui.form;
        form.on('radio(radio)', function (data) {
            switch (parseInt(data.value)) {
                case 1:
                    cascader.render({
                        elem: '#demoCascader9',
                        data:userList,
                        filterable: true,
                        multiple: true,
                        onChange: function (values, data) {
                            $("#demoCascader9").val(data.value)
                        }
                    });
                    break;
                case 2:
                    cascader.render({
                        elem: '#demoCascader9',
                        data: roleList,
                        filterable: true,
                        multiple: true,
                        onChange: function (values, data) {
                            $("#demoCascader9").val(data.value)
                        }
                    });
                    break;
                case 3:
                    cascader.render({
                        elem: '#demoCascader9',
                        data: orgList,
                        filterable: true,
                        multiple: true,
                        onChange: function (values, data) {
                            $("#demoCascader9").val(data.value)
                        }
                    });
                    break;
            }
        })
    });

    function queryUserList() {
        var yellows = doPostSync('/office/user/queryYellow');
        approveNodes = yellows.obj;
        var result = approveNodes.map(item => {
            var i = {}
            i.value = item.id;
            i.label = item.text;
            i.name = item.name
            return i;
        })
        userList = result;
        return result;
    }
    function getMainOrgList() {
        $.get('/office/org/selectMainOrgList', function (res) {
            let data = [{value: '1x', label: '用人部门'}, {value: '2x', label: '分管'}, {value: '3x', label: '直属领导'},];
            var temp = temp = res.obj.map(item => {
                var x = {};
                x.label = item.orgName;
                x.value = item.orgId;
                return x
            })
            data = data.concat(temp);
            orgList = data;
        })
    }
    function getRoleList() {
        var param={page:1,rows:1000}
        $.post('/office/role/list',param,function (res) {
            roleList= res.rows.map(item=>{
                let x={}
                x.label=item.roleName
                x.value=item.roleId;
                return x;
            })
        })

    }
</script>
</html>
